-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test installer commands #182
Conversation
This adds testing infrastructure to test against multiple versions of Rails, including Rails `main` branch.
This adds test coverage for the shared behavior of the installer commands. The commands are tested against a freshly generated Rails app using the version of Rails that is currently loaded. Thus the installers can be tested with different versions of Rails in CI.
This adds test coverage for specific behavior of the `javascript:install:bun` command.
This adds test coverage for specific behavior of the `javascript:install:esbuild` command.
This adds test coverage for specific behavior of the `javascript:install:rollup` command.
This adds test coverage for specific behavior of the `javascript:install:webpack` command.
ea9f41d
to
be1afa7
Compare
rails_version = ENV["RAILS_VERSION"] || "6.1.0" | ||
gem "rails", "~> #{rails_version}" | ||
|
||
gem "appraisal" | ||
gem "rails", "~> 6.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file defaulted the Rails version to 6.1, but the gemspec specifies 6.0. Which is correct? (Or do we want to jump to Rails 7.0?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should retain compatibility with 6.0.
ruby-version: | ||
- "3.1" | ||
- "3.2" | ||
- "3.3" | ||
gemfile: | ||
- gemfiles/rails_7_0.gemfile | ||
- gemfiles/rails_7_1.gemfile | ||
- gemfiles/rails_main.gemfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only tests with Rails >= 7.0 and Ruby >= 3.1. I can add entries for Rails 6.0 and 6.1, and older versions of Ruby, but first I wanted to confirm which versions we want to support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to focus on these for now.
This PR looks large because this project currently has no testing infrastructure. The vast majority of LOC in this PR are from
Gemfile
andGemfile.lock
files. I have split the PR into multiple commits to further clarify.This adds test coverage for the
javascript:install:bun
,javascript:install:esbuild
,javascript:install:rollup
, andjavascript:install:webpack
commands. The commands are tested against a freshly generated Rails app using the version of Rails that is currently loaded. Thus the installer can be tested with different versions of Rails in CI.Infrastructure has been added to run tests against Rails 7.0, 7.1, and
main
branch.This PR takes a different approach than rails/dartsass-rails#49 — instead of separate appraisals / gemfiles for Sprockets and Propshaft, this PR has tests that target each.